<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.Format"%>
<%@page import="firstping.model.Domain"%>
<%@page import="java.util.List"%>
<%@page import="firstping.model.Customer"%>
<%
	String title = (String) request.getAttribute("title");
	String description = (String) request.getAttribute("description");
	String keywords = (String) request.getAttribute("keyword");

	String success = (String) request.getAttribute("success");
	String customer = (String) session.getAttribute("customer");
	List<Domain> domains = (List<Domain>) request
			.getAttribute("domains");
	String[] check = (String[]) request.getAttribute("check");
%>
<jsp:include page="layout/header.jsp">
	<jsp:param name="title" value="<%=title %>" />
	<jsp:param name="description" value="<%=description %>" />
	<jsp:param name="keywords" value="<%=keywords %>" />
</jsp:include>
<div id="mainpage">
	<div id="maincontent">
		<h1>Add site</h1>

		<div class="box-wrapper">
			<div class="accountinfo">
				<div class="leftside">
					<h2>Add the site to monitor</h2>
					<form action="" method="post" class='form add-site'>
						<%=(check[0] != null) ? "<p style='color:red;'>" + check[0] + "</p>" : ""%>
						<%=(check[1] != null) ? "<p style='color:red;'>" + check[1] + "</p>" : ""%>
						<%=(success != null) ? "<p style='color:blue;'>" + success + "</p>" : ""%>
						<input type="text" name="site" class="input" />
						<button class="button-style">Add</button>
						<div><strong>Example</strong>: http://example.com</div>
					</form>					
				</div>
				<div class="rightside">
					<h2>My Account</h2>
					<ul>
						<li class="subinfo"><strong>Exp date</strong> : <%
							Format formatter = new SimpleDateFormat("MM/dd/yy");
							String s = formatter.format(session.getAttribute("exp"));
							out.print(s);
						%> <br /> <strong>Type</strong> : <%=session.getAttribute("type")%>
							<br /> <strong>Request</strong> : <%=session.getAttribute("req")%>
							Minutes <a class="button-style" href="/update">Update Account</a>
						</li>
						<li><a href="/account">Account</a></li>
						<li><a href="/add-site">Add site</a></li>
						<li><a href="/change-password">Change password</a></li>
						<li><a href="/logout">Logout</a></li>
					</ul>
				</div>
				<div class="clearbreak"></div>
			</div>
		</div>
	</div>
</div>
<jsp:include page="/layout/footer.jsp">
	<jsp:param name="language" value="1" />
</jsp:include>
